<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="tpl">dfd</div>
<script>
    var res,tbl,html,i;
     res = <?php echo ($users); ?>;
    tbl=document.getElementById('tpl');
    html='<table border="1">';
    for(i in res){
        html +='<tr><td>'+res[i].uname+'</td><td>'+res[i].age+'</td></tr>';
    }
    html +='</table>';
    tbl.innerHTML=html;
   // console.log(res);
    //console.log(res[0]['name']);
</script>
</body>
</html>